﻿#if PROFILE
using System;

namespace EntityGraph.SQL
{
    public class SqlQueryStats
    {
        public static TimeSpan TotalQueryTime { get; set; }
        public static int QueryCount { get; set; }
        public static int AttachedEntitiesCount { get; set; }
        public static int RowCount { get; set; }
        public static int QuerySetSize { get; set; }
        public static void Reset()
        {
            TotalQueryTime = TimeSpan.Zero;
            QueryCount = AttachedEntitiesCount = RowCount = QuerySetSize = 0;
        }
        public override string ToString()
        {
            return String.Format("queries={0}, queryset={1}, attached={2}, rowcount={3} qtime={4}",
                SqlQueryStats.QueryCount,
                SqlQueryStats.QuerySetSize,
                SqlQueryStats.AttachedEntitiesCount,
                SqlQueryStats.RowCount,
                SqlQueryStats.TotalQueryTime);
        }
    }
}
#endif
